package com.cloudxingkong.dianyinke.Student.Ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.cloudxingkong.dianyinke.R;

/**
 * Created by 44260 on 2016/6/4.
 */
public class BaseActivity extends AppCompatActivity {
	@Override
	protected void onCreate (Bundle savedInstanceState) {
		super.onCreate (savedInstanceState);
		onCreateView (savedInstanceState);
		initToolbar ();
	}

	/**
	 * Used for set contentView ,replace the {@link #onCreate(Bundle)}
	 *
	 * @param savedInstanceState the savedInstanceState
	 */
	protected void onCreateView (Bundle savedInstanceState) {

	}

	protected void initToolbar () {
		Toolbar toolbar = (Toolbar) findViewById (R.id.toolbar);
		toolbar.setNavigationIcon (R.drawable.selector_ic_back);
		toolbar.setNavigationOnClickListener (new View.OnClickListener () {
			@Override
			public void onClick (View v) {
				finish ();
			}
		});
	}
}
